<?php

namespace app\lijunxuan\controller;

use app\common\LijunxuanController;
use app\lijunxuan\model\Weblog as WeblogDB;
class Weblog extends LijunxuanController
{
  public function initialize()
  {
    $this->model = new WeblogDB();
  }

  public function printLog()
  {
    $post = request()->post();
    $post['ipaddress'] = request()->header('x-real-ip');
    $post['log_type'] = $post['logType'];
    $res = $this->model->save($post);
    if (!$res) {
      return error('失败');
    }
    return success('成功', '');
  }
}